<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>发现页面</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_956742_if4u2ec187h.css">
    <style>

      .hj_list{
        margin-left: 0.5rem;
        margin-right: 0.5rem;
      }
      .img_box{
        width: 1rem;
        padding: 0.25rem;
      }
      .img_box img{
        width: 100%;
      }
      .img_box .logo{

      }

      .main_content{
        width: 0;
        overflow: hidden;
        padding-left: 0.5rem;
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        border-bottom: 1px solid #f6f6f6;
      }

      .main_content .title{
        font-size: 0.8rem;
        color: #333;
      }

      i{
        color: #4A4A4A;
        font-size: 0.4rem;
      }
    </style>
</head>

<body>
    <div class="wrap hj_margin_t_5">
      <div onclick="openMini(0)" class="hj_list">
        <div class="flex flex_center">
          <div class="img_box flex flex_center">
            <img class="logo" src="../images/fire_control.png" alt="">
          </div>
          <div class="main_content flex_1 flex_column flex_around">
            <div class="title">老妖精消防</div>
          </div>
          <div class="right">
            <i class="iconfont icon-right"></i>
          </div>
        </div>
      </div>

      <div onclick="openMini(1)" class="hj_list">
        <div class="flex flex_center">
          <div class="img_box flex flex_center">
            <img class="logo" src="../images/drainage.png" alt="">
          </div>
          <div class="main_content flex_1 flex_column flex_around">
            <div class="title">老妖精给排水</div>
          </div>
          <div class="right">
            <i class="iconfont icon-right"></i>
          </div>
        </div>
      </div>

      <div onclick="openMini(2)" class="hj_list">
        <div class="flex flex_center">
          <div class="img_box flex flex_center">
            <img class="logo" src="../images/builder.png" alt="">
          </div>
          <div class="main_content flex_1 flex_column flex_around">
            <div class="title">老妖精建造师</div>
          </div>
          <div class="right">
            <i class="iconfont icon-right"></i>
          </div>
        </div>
      </div>

    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript">

    var wx = null;
    var userName = null;

    apiready = function() {
      wx = api.require('wx');
    };

    function openMini(type){
      switch (type) {
        case 0:
          userName = 'gh_96c7706f8ae6';
          break;
        case 1:
          userName = 'gh_de01761f55dc';
          break;
        case 2:
          userName = 'gh_a61b7c1ec70e';
          break;
        default:

      }

      wx.launchMiniProgram({
          miniProgramType: 'release',
          userName: userName
      }, function(ret, err) {
          if (ret.status) {
              alert('成功');
          } else {
              alert(err.code);
          }
      });
    }
</script>

</html>
